<?php

class BlogAction extends CommonAction {
	
	/**
	 * 更新blog的imageurl
	 * Enter description here ...
	 */
	public function updateImageUrl(){
		$id = $_REQUEST ['id'];
		$imageurl = $_REQUEST ['imageurl'];
		
		$model = M ( $this->getActionName());
		
		$condition['id'] = $id;
		$data['imageurl'] = $imageurl;
		
		$result = $model->where($condition)->save($data);
		
		if ($result != -1) {
			//$this->assign ( "jumpUrl", $this->getReturnUrl());
			$this->success ( '图片修改成功！' );
		} else {
			$this->error ( '图片修改失败！' );
		}
		/*
		if ($result != -1) {
			$this->ajaxReturn ( "111111", "更新成功", 1 );
		}else{
			$this->ajaxReturn ( "111111", $model->getError (), 1 );
		}*/
	}
	
	
	
	/**
	 * 获取图片
	 * Enter description here ...
	 */
	public function image(){
		$conditon ['id'] = $_REQUEST ['id'] ;
		if($_REQUEST ['type']=='blog'){
			$this->assign("image",$this->CommonSimplequery($conditon,$this->getActionName(),1));
		}if($_REQUEST ['type']=='bulletin'){
			$this->assign("image",$this->CommonSimplequery($conditon,'viewbulletin',1));
		}
		
		$this->display();		
	}
	



}

?>